package com.afdor.rws.dtm.serialize.nativejava;

import com.afdor.rws.dtm.serialize.ObjectInput;
import com.afdor.rws.dtm.serialize.ObjectOutput;
import com.afdor.rws.dtm.serialize.ObjectSerializer;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class NativeJavaSerialization implements ObjectSerializer {

    public static final String NAME = "nativejava";

    @Override
    public String getContentType() {
        return "x-application/rws-nativejava";
    }

    @Override
    public ObjectOutput serialize(OutputStream output) throws IOException {
        return new NativeJavaObjectOutput(output);
    }

    @Override
    public ObjectInput deserialize(InputStream input) throws IOException {
        return new NativeJavaObjectInput(input);
    }
}
